/**
 * Created by Administrator on 2017/3/24.
 */

import Relay from "react-relay";

export default class FindUserListMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { findUserList }`;
    }

    getVariables() {
        return {
            argsInput: {
                pageSize: this.props.pageSize,
                pageNum: this.props.pageNum,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on findUserListPayload {
            findUserList {
                errorCode
                value
                totalResult
                id
                token
                userModelList{
                    uid
                    name
                    phone
                    status
                    registerDate
                    enterpriseDomainList{
                        enterpriseName
                    }
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
              fragment on findUserListPayload {
                   findUserList {
                        errorCode
                        value
                        totalResult
                        id
                        token
                        userModelList{
                            uid
                            name
                            phone
                            status
                            registerDate
                            enterpriseDomainList{
                                enterpriseName
                            }
                        }
                    }
                }
            `]
        }];
    }
}

